#pragma once
#include "DXContext.h"
#include "enums.h"

namespace DXBase
{
	namespace D2D
	{
		[Windows::Foundation::Metadata::WebHostHidden]
		public ref class StrokeStyle sealed
		{
			Microsoft::WRL::ComPtr<ID2D1StrokeStyle> style;

			D2D1_STROKE_STYLE_PROPERTIES properties;
			Windows::Foundation::Collections::IVectorView<float>^ dashes;

		internal:
			Microsoft::WRL::ComPtr<ID2D1StrokeStyle> GetNativeStrokeStyle();

		public:
			StrokeStyle();

			property CAP_STYLE StartCap
			{
				CAP_STYLE get() { return static_cast<CAP_STYLE>(properties.startCap); }
				void set(CAP_STYLE value)
				{
					style = nullptr;
					properties.startCap = static_cast<D2D1_CAP_STYLE>(value);
				}
			}
			property CAP_STYLE EndCap
			{
				CAP_STYLE get() { return static_cast<CAP_STYLE>(properties.endCap); }
				void set(CAP_STYLE value)
				{
					style = nullptr;
					properties.endCap = static_cast<D2D1_CAP_STYLE>(value);
				}
			}
			property CAP_STYLE DashCap
			{
				CAP_STYLE get() { return static_cast<CAP_STYLE>(properties.dashCap); }
				void set(CAP_STYLE value)
				{
					style = nullptr;
					properties.dashCap = static_cast<D2D1_CAP_STYLE>(value);
				}
			}
			property LINE_JOIN LineJoin
			{
				LINE_JOIN get() { return static_cast<LINE_JOIN>(properties.lineJoin); }
				void set(LINE_JOIN value)
				{
					style = nullptr;
					properties.lineJoin = static_cast<D2D1_LINE_JOIN>(value);
				}
			}
			property float MiterLimit
			{
				float get() { return properties.miterLimit; }
				void set(float value)
				{
					style = nullptr;
					properties.miterLimit = value;
				}
			}
			property DASH_STYLE DashStyle
			{
				DASH_STYLE get() { return static_cast<DASH_STYLE>(properties.dashStyle); }
				void set(DASH_STYLE value)
				{
					style = nullptr;
					properties.dashStyle = static_cast<D2D1_DASH_STYLE>(value);
				}
			}
			property float DashOffset
			{
				float get() { return properties.dashOffset; }
				void set(float value)
				{
					style = nullptr;
					properties.dashOffset = (value);
				}
			}
			property Windows::Foundation::Collections::IVectorView<float>^ Dashes
			{
				Windows::Foundation::Collections::IVectorView<float>^ get() { return dashes; }
				void set(Windows::Foundation::Collections::IVectorView<float>^ value)
				{
					style = nullptr;
					dashes = (value);
				}
			}
		};
	}
}